#include "FMath.h"

float FMath::CalculateAngle(glm::vec3 v1, glm::vec3 v2)
{
	float TheNorm = glm::length(v1) * glm::length(v2);

	float theta = glm::degrees(glm::acos(glm::dot(v1, v2) / TheNorm));

	glm::vec3 crossProduct = glm::cross(v1, v2);

	if (crossProduct.y >= 0)
		return theta;
	else
		return -theta;
}

bool FMath::IsEqual(double a, double b) {
	return std::abs(a - b) < 0.00001;
}

bool FMath::IsEmpty(glm::vec3 v)
{
	return glm::length(v) < TOLERANCE;
}
